﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UPMS.Core.Domain.Mapping
{
    public class OrganizationMap : BaseMap<Organization>
    {
        public OrganizationMap()
        {
            this.ToTable("Upms_tbl_Organization");
            this.Property(r => r.Name).HasColumnName("Name").IsRequired().HasMaxLength(64);

            this.HasMany(org => org.Departments).WithOptional(d => d.Orgaization).HasForeignKey(d => d.OrganizationId);
        }
    }
}
